import java.util.*;

/**
 * Author: Daniel Michalski
 * Date: 10.03.13
 */

public class HashMapTest {
    public static void main(String[] args) {
        Map<String, Double> hm = new TreeMap<>();

        hm.put("Jan Kowalski", new Double(3434.34));
        hm.put("Piotr Nowas", new Double(123.22));
        hm.put("Joanna Bąk", new Double(1978.00));
        hm.put("Rafał Brzęczyszczykiewicz", new Double(99.22));
        hm.put("Tomek Nosek", new Double(-19.08));

        for (Map.Entry<String, Double> entry : hm.entrySet()) {
            System.out.println(entry.getKey() + " " + entry.getValue());
        }

        System.out.println();

        double balance = hm.get("Jan Kowalski");
        hm.put("Jan Kowalski", balance + 1000);

        System.out.println("Nowy stan Jana Kowalskiego: " +
                           hm.get("Jan Kowalski"));


        Set<String> ts = new TreeSet<>();

        ts.add("B");
        ts.add("A");
        ts.add("D");
        ts.add("C");
        System.out.println(ts);

        ts = new HashSet<>();
        ts.add("B");
        ts.add("A");
        ts.add("D");
        ts.add("C");
        System.out.println(ts);
    }
}
